﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChongJu.EventManager.Rating
{
    public class StoreEvent
    {
        /// <summary>
        /// 仓储配置信息变动通知
        /// </summary>
        public static event Action<object> ConfigExchangeEventReport;
        public static void OnConfigExchange(object config)
        {
            ConfigExchangeEventReport?.Invoke(config);
        }



        /// <summary>
        /// 停止分拣  
        /// true 开始 
        /// fasle 暂停/停止
        /// </summary>
        public static event Action<bool> StartStopRatingEventReport;
        /// <summary>
        /// true 开始分拣
        /// fasle 暂停/停止分拣
        /// </summary>
        /// <param name="value"></param>
        public static void OnStartStopRating(bool value)
        {
            StartStopRatingEventReport?.Invoke(value);
        }



        /// <summary>
        /// 结束批次后清仓
        /// true 清仓开始
        /// fasle 清仓结束
        /// </summary>
        public static event Action<bool> ClearStoreStartStopEventReport;
        /// <summary>
        /// true 清仓开始
        /// fasle 清仓结束
        /// </summary>
        /// <param name="value"></param>
        public static void OnClearStoreStartStop(bool value)
        {
            ClearStoreStartStopEventReport?.Invoke(value);
        }



        /// <summary>
        /// 开仓
        /// </summary>
        public static event Action<int> OpenStoreEventReport;
        /// <summary>
        /// 打开第几料仓
        /// </summary>
        /// <param name="value"></param>
        public static void OnOpenStore(int value)
        {
            OpenStoreEventReport?.Invoke(value);
        }



        /// <summary>
        /// 保存数据失败
        /// </summary>
        public static event Action<string> SaveWeightFailEventReport;
        /// <summary>
        /// 保存数据失败 上报
        /// </summary>
        /// <param name="value"></param>
        public static void OnSaveWeightFail(string value)
        {
            SaveWeightFailEventReport?.Invoke(value);
        }
    }
}
